thin.imports('/public/configure/conf.complete.js');
thin.imports('/public/plug/drag/drag.custom.js');
thin.use(function() {
	showDragVerify({
		'sdv_createbox': 'dgx',
		'sdv_callback': function() {
			dragVerify = true;
		}
	});
	$('#submit-singin').off('click').on('click', submitSingIn);
});

var dragVerify = false,
	__getdata_mblogin = {};

function submitSingIn() {
	var data_opt = {
		'mobile': $('#ipt-mb-mobile').val(),
		'password': $('#ipt-mb-password').val()
	};
	if(data_opt.mobile == '') {
		layer.msg('请输入手机号', {
			icon: 2,
			time: 800
		});
		return;
	} else if(data_opt.password == '') {
		layer.msg('请输入密码', {
			icon: 2,
			time: 800
		});
		return;
	} else if(!dragVerify) {
		layer.msg('拖动滑块验证', {
			icon: 2,
			time: 800
		});
		return;
	}
	layer.load(0, {
		shade: [0.08, '#000']
	});
	__getdata_mblogin = data_opt;
	factory.request('_mem_login');
}

function __complete_mblogin(res) {
	layer.closeAll('loading');
	if (res.status == 201) {
		layer.msg('登录成功');
		setTimeout(function() {
			window.location.href = '/member.html#member';
		}, 1200);
	} else {
		layer.msg(res.error, {
			icon: 2,
			time: 800
		});
	}
}
